# from flask import  request
# from flask_restful import Resource
# from database import Database
# from datetime import datetime
#
#
# # 创建数据库连接
# db_connection = Database().get_connection()
# cursor =db_connection.cursor()
# # Mock user database
#
# class Order(Resource):
#     def post(self):
#         data = request.get_json()
#         managerId= data['managerId']
#         status = 'in process'
#         quantity = data['quantity']
#         cursor.execute("SELECT * FROM orderids ")
#         orderId = cursor.fetchone()
#         orderId1=str(orderId[0])
#         if orderId1 is not None:
#             cursor.execute("INSERT INTO `order` (orderId, userId, status, quantity) VALUES (%s,  %s, %s, %s)",
#                            (orderId1, user_id, status, quantity))
#             cursor.execute("UPDATE orderids SET OrderID = OrderID + 1")
#
#             # Commit the transaction
#             db_connection.commit()
#
#             return {"message": "insert a order successfully"}, 200
#         else:
#             return {"message": "insert a order fail"}, 409  # Changed return status to 409 Conflict
#
